<%--
  Created by IntelliJ IDEA.
  User: jiangxuchuan
  Date: 2022/1/8
  Time: 13:10
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Core</title>
</head>
<body>
    <h1>${requestScope.grade}</h1>
    <!-- c:if判断语句，由于没有else，所以只能都用if一条一条输出 -->
    <c:if test="${requestScope.grade > 60}">
        <h1 style="color: green">PASS! :)</h1>
    </c:if>
    <c:if test="${requestScope.grade < 60}">
        <h1 style="color: red">sorry,please try again :(</h1>
    </c:if>

    <!--choose when otherwise 相当于if elif else -->
    <c:choose>
        <c:when test="${requestScope.level == 'A'}">
            <h1 style="color: aqua">level is A</h1>
        </c:when>
        <c:when test="${requestScope.level == 'B'}">
            <h1 style="color: aquamarine">level is B</h1>
        </c:when>
        <c:when test="${requestScope.level == 'C'}">
            <h1 style="color: blueviolet">level is C</h1>
        </c:when>
        <c:otherwise>
            <h1 style="color: red">error !</h1>
        </c:otherwise>
    </c:choose>
</body>
</html>
